//
//  STTools_BaseNavagationView.m
//  SaiMer
//
//  Created by coderBook on 2019/5/25.
//  Copyright © 2019 stoneobs.qq.com. All rights reserved.
//

#import "STTools_BaseNavagationView.h"

@implementation STTools_BaseNavagationView
+ (STTools_BaseNavagationView*)defultNavgaitionView{
    STTools_BaseNavagationView * navView = [[STTools_BaseNavagationView alloc] initWithFrame:CGRectMake(0, 0, STONEOBS_UI_UISCREEN_WIDTH, TMUtils.stoneobs_fun_get_navgationBarBootom)];
    [navView stoneobs_ui_configSubView];
    return navView;
}
#pragma mark --subView
- (void)stoneobs_ui_configSubView{
    __weak typeof(self) weakSelf =  self;
    ({
        STButton * buButton = [[STButton alloc] initWithFrame:CGRectMake(15, 0, 40, 44)
                                                          title:@""
                                                     titleColor:UIColor.whiteColor
                                                      titleFont:16
                                                   cornerRadius:0
                                                backgroundColor:nil
                                                backgroundImage:nil
                                                          image:[UIImage imageNamed:@"icon_nav_back"]];
        buButton.bottom = TMUtils.stoneobs_fun_get_navgationBarBootom;
        [self addSubview:buButton];
        self.leftButton = buButton;
        [buButton stoneobs_fun_touch_handle:^(UIButton *sender) {
            [TMUtils.stoneobs_fun_get_currentTopController.navigationController popViewControllerAnimated:YES];
        }];
    });

    ({
        STButton * buButton = [[STButton alloc] initWithFrame:CGRectMake(15, 0, 100, 44)
                                                        title:@""
                                                   titleColor:STONEOBS_UI_FIRST_TEXT_COLOR
                                                    titleFont:18
                                                 cornerRadius:0
                                              backgroundColor:nil
                                              backgroundImage:nil
                                                        image:nil];
        buButton.bottom = TMUtils.stoneobs_fun_get_navgationBarBootom;
        buButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
        [self addSubview:buButton];
        buButton.right = STONEOBS_UI_UISCREEN_WIDTH - 15;
        self.rightButton = buButton;
        
        
    });
    
    
    
    ({
        STButton * buButton = [[STButton alloc] initWithFrame:CGRectMake(15, 0, 40, 44)
                                                        title:@""
                                                   titleColor:UIColor.blackColor
                                                    titleFont:22
                                                 cornerRadius:0
                                              backgroundColor:nil
                                              backgroundImage:nil
                                                        image:nil];
        buButton.bottom = TMUtils.stoneobs_fun_get_navgationBarBootom;
        buButton.titleLabel.font = [UIFont fontWithName:STONEOBS_UI_FONT_CU_NAME size:22];
        buButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        [self addSubview:buButton];
        buButton.width = self.rightButton.left - self.leftButton.right-20;
        buButton.centerX = STONEOBS_UI_UISCREEN_WIDTH/2;
        self.titleButton = buButton;
    });
    
    self.backgroundColor = STONEOBS_UI_NAV_COLOR;
}
@end
